Integrand size = 21, antiderivative size = 55 \[ \int \frac {\csc (e+f x)}{a+b \sec ^2(e+f x)} \, dx=\frac {\sqrt {b} \arctan \left (\frac {\sqrt {a} \cos (e+f x)}{\sqrt {b}}\right )}{\sqrt {a} (a+b) f}-\frac {\text {arctanh}(\cos (e+f x))}{(a+b) f} \]
Result contains complex when optimal does not.
Time = 1.24 (sec) , antiderivative size = 239, normalized size of antiderivative = 4.35 \[ \int \frac {\csc (e+f x)}{a+b \sec ^2(e+f x)} \, dx=\frac {\frac {\sqrt {b} \arctan \left (\frac {\left (-\sqrt {a}-i \sqrt {a+b} \sqrt {(\cos (e)-i \sin (e))^2}\right ) \sin (e) \tan \left (\frac {f x}{2}\right )+\cos (e) \left (\sqrt {a}-\sqrt {a+b} \sqrt {(\cos (e)-i \sin (e))^2} \tan \left (\frac {f x}{2}\right )\right )}{\sqrt {b}}\right )}{\sqrt {a}}+\frac {\sqrt {b} \arctan \left (\frac {\left (-\sqrt {a}+i \sqrt {a+b} \sqrt {(\cos (e)-i \sin (e))^2}\right ) \sin (e) \tan \left (\frac {f x}{2}\right )+\cos (e) \left (\sqrt {a}+\sqrt {a+b} \sqrt {(\cos (e)-i \sin (e))^2} \tan \left (\frac {f x}{2}\right )\right )}{\sqrt {b}}\right )}{\sqrt {a}}-\log \left (\cos \left (\frac {1}{2} (e+f x)\right )\right )+\log \left (\sin \left (\frac {1}{2} (e+f x)\right )\right )}{(a+b) f} \]
((Sqrt[b]*ArcTan[((-Sqrt[a] - I*Sqrt[a + b]*Sqrt[(Cos[e] - I*Sin[e])^2])*S in[e]*Tan[(f*x)/2] + Cos[e]*(Sqrt[a] - Sqrt[a + b]*Sqrt[(Cos[e] - I*Sin[e] )^2]*Tan[(f*x)/2]))/Sqrt[b]])/Sqrt[a] + (Sqrt[b]*ArcTan[((-Sqrt[a] + I*Sqr t[a + b]*Sqrt[(Cos[e] - I*Sin[e])^2])*Sin[e]*Tan[(f*x)/2] + Cos[e]*(Sqrt[a ] + Sqrt[a + b]*Sqrt[(Cos[e] - I*Sin[e])^2]*Tan[(f*x)/2]))/Sqrt[b]])/Sqrt[ a] - Log[Cos[(e + f*x)/2]] + Log[Sin[(e + f*x)/2]])/((a + b)*f)
Time = 0.24 (sec) , antiderivative size = 54, normalized size of antiderivative = 0.98, number of steps used = 6, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.238, Rules used = {3042, 4621, 383, 218, 219}
Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.
\(\displaystyle \int \frac {\csc (e+f x)}{a+b \sec ^2(e+f x)} \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {1}{\sin (e+f x) \left (a+b \sec (e+f x)^2\right )}dx\) |
\(\Big \downarrow \) 4621 |
\(\displaystyle -\frac {\int \frac {\cos ^2(e+f x)}{\left (1-\cos ^2(e+f x)\right ) \left (a \cos ^2(e+f x)+b\right )}d\cos (e+f x)}{f}\) |
\(\Big \downarrow \) 383 |
\(\displaystyle -\frac {\frac {\int \frac {1}{1-\cos ^2(e+f x)}d\cos (e+f x)}{a+b}-\frac {b \int \frac {1}{a \cos ^2(e+f x)+b}d\cos (e+f x)}{a+b}}{f}\) |
\(\Big \downarrow \) 218 |
\(\displaystyle -\frac {\frac {\int \frac {1}{1-\cos ^2(e+f x)}d\cos (e+f x)}{a+b}-\frac {\sqrt {b} \arctan \left (\frac {\sqrt {a} \cos (e+f x)}{\sqrt {b}}\right )}{\sqrt {a} (a+b)}}{f}\) |
\(\Big \downarrow \) 219 |
\(\displaystyle -\frac {\frac {\text {arctanh}(\cos (e+f x))}{a+b}-\frac {\sqrt {b} \arctan \left (\frac {\sqrt {a} \cos (e+f x)}{\sqrt {b}}\right )}{\sqrt {a} (a+b)}}{f}\) |
-((-((Sqrt[b]*ArcTan[(Sqrt[a]*Cos[e + f*x])/Sqrt[b]])/(Sqrt[a]*(a + b))) + ArcTanh[Cos[e + f*x]]/(a + b))/f)
3.1.31.3.1 Defintions of rubi rules used
Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(Rt[a/b, 2]/a)*ArcTan[x/R t[a/b, 2]], x] /; FreeQ[{a, b}, x] && PosQ[a/b]
Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[-b, 2]))* ArcTanh[Rt[-b, 2]*(x/Rt[a, 2])], x] /; FreeQ[{a, b}, x] && NegQ[a/b] && (Gt Q[a, 0] || LtQ[b, 0])
Int[((e_.)*(x_))^(m_.)/(((a_) + (b_.)*(x_)^2)*((c_) + (d_.)*(x_)^2)), x_Sym bol] :> Simp[(-a)*(e^2/(b*c - a*d)) Int[(e*x)^(m - 2)/(a + b*x^2), x], x] + Simp[c*(e^2/(b*c - a*d)) Int[(e*x)^(m - 2)/(c + d*x^2), x], x] /; Free Q[{a, b, c, d, e, m}, x] && NeQ[b*c - a*d, 0] && LeQ[2, m, 3]
Int[((a_) + (b_.)*sec[(e_.) + (f_.)*(x_)]^(n_))^(p_.)*sin[(e_.) + (f_.)*(x_ )]^(m_.), x_Symbol] :> With[{ff = FreeFactors[Cos[e + f*x], x]}, Simp[-ff/f Subst[Int[(1 - ff^2*x^2)^((m - 1)/2)*((b + a*(ff*x)^n)^p/(ff*x)^(n*p)), x], x, Cos[e + f*x]/ff], x]] /; FreeQ[{a, b, e, f}, x] && IntegerQ[(m - 1)/ 2] && IntegerQ[n] && IntegerQ[p]
Time = 0.14 (sec) , antiderivative size = 71, normalized size of antiderivative = 1.29
method | result | size |
derivativedivides | \(\frac {\frac {\ln \left (-1+\cos \left (f x +e \right )\right )}{2 a +2 b}+\frac {b \arctan \left (\frac {a \cos \left (f x +e \right )}{\sqrt {a b}}\right )}{\left (a +b \right ) \sqrt {a b}}-\frac {\ln \left (1+\cos \left (f x +e \right )\right )}{2 a +2 b}}{f}\) | \(71\) |
default | \(\frac {\frac {\ln \left (-1+\cos \left (f x +e \right )\right )}{2 a +2 b}+\frac {b \arctan \left (\frac {a \cos \left (f x +e \right )}{\sqrt {a b}}\right )}{\left (a +b \right ) \sqrt {a b}}-\frac {\ln \left (1+\cos \left (f x +e \right )\right )}{2 a +2 b}}{f}\) | \(71\) |
risch | \(-\frac {\ln \left ({\mathrm e}^{i \left (f x +e \right )}+1\right )}{f \left (a +b \right )}+\frac {\ln \left ({\mathrm e}^{i \left (f x +e \right )}-1\right )}{f \left (a +b \right )}+\frac {i \sqrt {a b}\, \ln \left ({\mathrm e}^{2 i \left (f x +e \right )}+\frac {2 i \sqrt {a b}\, {\mathrm e}^{i \left (f x +e \right )}}{a}+1\right )}{2 a \left (a +b \right ) f}-\frac {i \sqrt {a b}\, \ln \left ({\mathrm e}^{2 i \left (f x +e \right )}-\frac {2 i \sqrt {a b}\, {\mathrm e}^{i \left (f x +e \right )}}{a}+1\right )}{2 a \left (a +b \right ) f}\) | \(147\) |
1/f*(1/(2*a+2*b)*ln(-1+cos(f*x+e))+b/(a+b)/(a*b)^(1/2)*arctan(a*cos(f*x+e) /(a*b)^(1/2))-1/(2*a+2*b)*ln(1+cos(f*x+e)))
Time = 0.28 (sec) , antiderivative size = 156, normalized size of antiderivative = 2.84 \[ \int \frac {\csc (e+f x)}{a+b \sec ^2(e+f x)} \, dx=\left [\frac {\sqrt {-\frac {b}{a}} \log \left (-\frac {a \cos \left (f x + e\right )^{2} + 2 \, a \sqrt {-\frac {b}{a}} \cos \left (f x + e\right ) - b}{a \cos \left (f x + e\right )^{2} + b}\right ) - \log \left (\frac {1}{2} \, \cos \left (f x + e\right ) + \frac {1}{2}\right ) + \log \left (-\frac {1}{2} \, \cos \left (f x + e\right ) + \frac {1}{2}\right )}{2 \, {\left (a + b\right )} f}, \frac {2 \, \sqrt {\frac {b}{a}} \arctan \left (\frac {a \sqrt {\frac {b}{a}} \cos \left (f x + e\right )}{b}\right ) - \log \left (\frac {1}{2} \, \cos \left (f x + e\right ) + \frac {1}{2}\right ) + \log \left (-\frac {1}{2} \, \cos \left (f x + e\right ) + \frac {1}{2}\right )}{2 \, {\left (a + b\right )} f}\right ] \]
[1/2*(sqrt(-b/a)*log(-(a*cos(f*x + e)^2 + 2*a*sqrt(-b/a)*cos(f*x + e) - b) /(a*cos(f*x + e)^2 + b)) - log(1/2*cos(f*x + e) + 1/2) + log(-1/2*cos(f*x + e) + 1/2))/((a + b)*f), 1/2*(2*sqrt(b/a)*arctan(a*sqrt(b/a)*cos(f*x + e) /b) - log(1/2*cos(f*x + e) + 1/2) + log(-1/2*cos(f*x + e) + 1/2))/((a + b) *f)]
\[ \int \frac {\csc (e+f x)}{a+b \sec ^2(e+f x)} \, dx=\int \frac {\csc {\left (e + f x \right )}}{a + b \sec ^{2}{\left (e + f x \right )}}\, dx \]
Time = 0.26 (sec) , antiderivative size = 64, normalized size of antiderivative = 1.16 \[ \int \frac {\csc (e+f x)}{a+b \sec ^2(e+f x)} \, dx=\frac {\frac {2 \, b \arctan \left (\frac {a \cos \left (f x + e\right )}{\sqrt {a b}}\right )}{\sqrt {a b} {\left (a + b\right )}} - \frac {\log \left (\cos \left (f x + e\right ) + 1\right )}{a + b} + \frac {\log \left (\cos \left (f x + e\right ) - 1\right )}{a + b}}{2 \, f} \]
1/2*(2*b*arctan(a*cos(f*x + e)/sqrt(a*b))/(sqrt(a*b)*(a + b)) - log(cos(f* x + e) + 1)/(a + b) + log(cos(f*x + e) - 1)/(a + b))/f
Time = 0.29 (sec) , antiderivative size = 85, normalized size of antiderivative = 1.55 \[ \int \frac {\csc (e+f x)}{a+b \sec ^2(e+f x)} \, dx=-\frac {\frac {2 \, b \arctan \left (-\frac {a \cos \left (f x + e\right ) - b}{\sqrt {a b} \cos \left (f x + e\right ) + \sqrt {a b}}\right )}{\sqrt {a b} {\left (a + b\right )}} - \frac {\log \left (\frac {{\left | -\cos \left (f x + e\right ) + 1 \right |}}{{\left | \cos \left (f x + e\right ) + 1 \right |}}\right )}{a + b}}{2 \, f} \]
-1/2*(2*b*arctan(-(a*cos(f*x + e) - b)/(sqrt(a*b)*cos(f*x + e) + sqrt(a*b) ))/(sqrt(a*b)*(a + b)) - log(abs(-cos(f*x + e) + 1)/abs(cos(f*x + e) + 1)) /(a + b))/f
Time = 0.25 (sec) , antiderivative size = 123, normalized size of antiderivative = 2.24 \[ \int \frac {\csc (e+f x)}{a+b \sec ^2(e+f x)} \, dx=-\frac {\mathrm {atanh}\left (\frac {\cos \left (e+f\,x\right )\,\left (2\,a^3+2\,a\,b^2\right )-\frac {\cos \left (e+f\,x\right )\,\left (8\,a^5+8\,a^4\,b-8\,a^3\,b^2-8\,a^2\,b^3\right )}{4\,{\left (a+b\right )}^2}}{2\,a\,b\,\left (a+b\right )}\right )}{f\,\left (a+b\right )}-\frac {\mathrm {atanh}\left (\frac {\cos \left (e+f\,x\right )\,\sqrt {-a\,b}}{b}\right )\,\sqrt {-a\,b}}{f\,\left (a^2+b\,a\right )} \]